<?php

if ( !defined( 'BASEPATH' ) ) exit( 'No direct script access allowed' );

/**
 * 搜索控制器
 */
class Query extends MY_Controller
{

    public function index()
    {
        $keyword = strip_tags( urldecode( $this->input->get('s') ) );
        $offset = intval( $this->input->get('p') );
        
        //搜索
        $search_form = Modules::run( 'search', $keyword );
        $data['search_form'] = $search_form;

        //结果列表
        $info_list = Modules::run( 'info/search', $keyword, $offset );
        $data['info_list'] = $info_list;
        
        $data['title'] = '搜索';
        
        $this->get_common_section( $data );
        $this->load->view( 'search', $data );
    }

}